package com.woniuxy.cloud.carl.marketing.client;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.woniuxy.cloud.carl.marketing.client.param.AddCouponParam;
import com.woniuxy.cloud.carl.marketing.client.param.AddDeductionParam;
import com.woniuxy.cloud.carl.marketing.client.param.GetCouponParam;
import com.woniuxy.cloud.carl.marketing.infra.model.Deduction;
import com.woniuxy.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 折扣券 前端控制器
 * </p>
 *
 * @author Lucas
 * @since 2023-07-19
 */
@FeignClient(contextId = "deductionClient",name = "marketing")
public interface DeductionClient {
    @PostMapping("/addDeductionCoupon")
    Result addDeductionCoupon(@RequestBody AddDeductionParam param);

    @GetMapping("/getDeduction")
    Result<Page<Deduction>> getDeduction(@SpringQueryMap GetCouponParam param);
    @GetMapping("/useDeduction")
    Result<Deduction> useDeduction(
            @RequestParam("spuId") Long spuId,@RequestParam("userId") Long userId,
            @RequestParam("couponId") String couponId);

}

